package collectionFramework;

// Vector: all methods are synchronized by default;
// Since the methods are synchronized, its more secure, but has low performance
// compared to Linked List.

import java.util.Enumeration;
import java.util.Vector;

public class MyVector {
	public static void main(String[] args) {
		Vector<Integer> v = new Vector<Integer>();
		v.add(10);
		v.add(50);
		v.add(30);
		v.add(60);
		v.add(90);

		System.out.println("Vector: " + v);
		v.removeElement(50);
		System.out.println("Vector (remove 50): " + v);

		Enumeration<Integer> en = v.elements();
		while (en.hasMoreElements())
			// hasMoreElement - an old method
			System.out.println(en.nextElement());// nextElement - an new method
	}
}
